﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.master" AutoEventWireup="true" CodeBehind="UnpaidConfirm.aspx.cs" Inherits="UdrinkWater_Project.Officer.UnpaidConfirm" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <dx:ASPxRoundPanel ID="ASPxRoundPanel1" runat="server" 
        HeaderText="รายการค้างชำระ" Width="100%">
        <HeaderStyle Font-Size="Medium" HorizontalAlign="Left" />
        <PanelCollection>
<dx:PanelContent runat="server" SupportsDisabledAttribute="True">
    <dx:ASPxButton ID="bt_AddUnpaid" runat="server" Text="ยืนยันการทำรายการ" 
        Width="104px" OnClick="bt_AddUnpaid_Click">
    </dx:ASPxButton>
    <dx:ASPxGridView ID="GV_UnpaidConfirm" runat="server" AutoGenerateColumns="False" 
        DataSourceID="SqlData_ListUnpaid" KeyFieldName="Unpaid_Date" Width="100%">
        <Columns>
            <dx:GridViewDataDateColumn FieldName="Unpaid_Date" ReadOnly="True" 
                ShowInCustomizationForm="True" Visible="False" VisibleIndex="0">
            </dx:GridViewDataDateColumn>
            <dx:GridViewDataTextColumn FieldName="Name" ShowInCustomizationForm="True" 
                VisibleIndex="1" Caption="ชื่อ - นามสกุล">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Address" ShowInCustomizationForm="True" 
                VisibleIndex="2" Caption="ที่อยู่">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataComboBoxColumn FieldName="District_ID" 
                ShowInCustomizationForm="True" VisibleIndex="3" Caption="ตำบล">
                <PropertiesComboBox DataSourceID="SqlData_District" TextField="DISTRICT_NAME" 
                    ValueField="DISTRICT_ID" ValueType="System.Int32">
                </PropertiesComboBox>
            </dx:GridViewDataComboBoxColumn>
            <dx:GridViewDataComboBoxColumn FieldName="Aumphur_ID" 
                ShowInCustomizationForm="True" VisibleIndex="4" Caption="อำเภอ">
                <PropertiesComboBox DataSourceID="SqlData_Aumphur" TextField="AMPHUR_NAME" 
                    ValueField="AMPHUR_ID" ValueType="System.Int32">
                </PropertiesComboBox>
            </dx:GridViewDataComboBoxColumn>
            <dx:GridViewDataComboBoxColumn FieldName="Province_ID" 
                ShowInCustomizationForm="True" VisibleIndex="5" Caption="จังหวัด">
                <PropertiesComboBox DataSourceID="SqlData_Province" TextField="PROVINCE_NAME" 
                    ValueField="PROVINCE_ID" ValueType="System.Int32">
                </PropertiesComboBox>
            </dx:GridViewDataComboBoxColumn>
            <dx:GridViewDataTextColumn FieldName="Count" 
                ShowInCustomizationForm="True" VisibleIndex="6" Caption="จำนวนเงิน">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataDateColumn FieldName="UnpaidDeadline_Date" 
                ShowInCustomizationForm="True" VisibleIndex="7" Caption="วันกำหนดชำระ">
            </dx:GridViewDataDateColumn>
            <dx:GridViewDataTextColumn FieldName="Act_Officer" 
                ShowInCustomizationForm="True" VisibleIndex="8" Caption="ผู้ทำรายการ" 
                Visible="False">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataComboBoxColumn FieldName="Status_Unpaid" 
                ShowInCustomizationForm="True" VisibleIndex="9" Caption="สถานะการชำระ">
                <PropertiesComboBox DataSourceID="SqlData_Status_Unpaid" 
                    TextField="Unpaid_Name" ValueField="Unpaid_ID" ValueType="System.Int32">
                </PropertiesComboBox>
            </dx:GridViewDataComboBoxColumn>
            <dx:GridViewDataTextColumn FieldName="Referent_Unpaid" 
                ShowInCustomizationForm="True" VisibleIndex="10" Caption="เอกสารอ้างอิง">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn ShowInCustomizationForm="True" VisibleIndex="11">
                <DataItemTemplate>
                    <dx:ASPxCheckBox ID="CheckBox1" runat="server" Text="ยืนยันการชำระเงิน">
                    </dx:ASPxCheckBox>
                </DataItemTemplate>
            </dx:GridViewDataTextColumn>
        </Columns>
        <SettingsPager Mode="ShowAllRecords">
        </SettingsPager>
    </dx:ASPxGridView>
    <asp:SqlDataSource ID="SqlData_ListUnpaid" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DB_Udrink %>" 
        
        SelectCommand="SELECT * FROM [TB_unpaid] WHERE ([Status_Unpaid] = @Status_Unpaid)">
        <SelectParameters>
            <asp:Parameter DefaultValue="2" Name="Status_Unpaid" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
            <asp:SqlDataSource ID="SqlData_District" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DB_Udrink %>" 
        SelectCommand="SELECT * FROM [TB_District]"></asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlData_Aumphur" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DB_Udrink %>" 
        SelectCommand="SELECT * FROM [TB_Aumphur]"></asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlData_Province" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DB_Udrink %>" 
        SelectCommand="SELECT * FROM [TB_Province]"></asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlData_Status_Unpaid" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DB_Udrink %>" 
        SelectCommand="SELECT * FROM [TB_StatusUnpaid]"></asp:SqlDataSource>
            </dx:PanelContent>
</PanelCollection>
    </dx:ASPxRoundPanel>
</asp:Content>
